'use strict';

angular.module('app')
    .controller('detailController', ['$scope', '$rootScope', '$state', '$timeout',
        function($scope, $rootScope, $state, $timeout) {
            var title = "充值规则详情";
            var id = $state.params.id;
             activate(id);
            $scope.title = $rootScope.title = title;
            $scope.loading = true;
            // 初始化页面
            function activate(id) {
                $scope.loading = true;
                $.ajax({
                    url : $scope.app.project_name+'/rechargeRule/read/detail',
                    data: {'ruleId': id}
                }).then(function(result) {
                    $scope.loading = false;
                    if (result.httpCode == 200) {
                        $scope.record = result.data;
                    } else {
                        $scope.msg = result.msg;
                    }
                    $scope.$apply();
                });
            }
        }]);